<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      label-width="68px"
    >
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >刷新</el-button
        >
      </el-form-item>
    </el-form>

    <el-table v-loading="loading" :data="roleList">
      <el-table-column label="编号" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="handleUpdate(scope.row)">{{
            scope.row.f12
          }}</el-button>
        </template>
      </el-table-column>
      
      <el-table-column label="名称" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f14
          }}</el-button>
        </template>
        </el-table-column> 
      <el-table-column label="时间" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text">{{
            scope.row.cdate
          }}</el-button>
        </template>
      </el-table-column>
       <el-table-column label="最新价" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f2
          }}</el-button>
        </template>        
      </el-table-column>
    <el-table-column label="涨跌幅" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f3
          }}</el-button>
        </template>        
      </el-table-column>  
    <el-table-column label="涨跌额" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f4
          }}</el-button>
        </template>        
      </el-table-column> 
    <el-table-column label="成交量" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f5
          }}</el-button>
        </template>        
      </el-table-column>
               <el-table-column label="成交额" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f6
          }}</el-button>
        </template>        
      </el-table-column>
               <el-table-column label="振幅" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f7
          }}</el-button>
        </template>        
      </el-table-column>      
       <el-table-column label="今开" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f17
          }}</el-button>
        </template>        
      </el-table-column>
       <el-table-column label="昨收" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f18
          }}</el-button>
        </template>        
      </el-table-column>
       <el-table-column label="量比" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f10
          }}</el-button>
        </template>        
      </el-table-column>
       <el-table-column label="换手率" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f8
          }}</el-button>
        </template>        
      </el-table-column>
       <el-table-column label="5分钟涨跌" prop="id" width="80">
        <template slot-scope="scope">
          <el-button size="mini" type="text" >{{
            scope.row.f11
          }}</el-button>
        </template>        
      </el-table-column>      
    </el-table>
  </div>
</template>

<script>
import { liststock} from "@/api/tool/card";
export default {
  name: "Astest",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 表格数据
      roleList: [],
      // 弹出层标题
      title: "",
      // 查询参数
      queryParams: {
        id: ""
      }
    };
  },
  created() {
    const id = this.$route.params && this.$route.params.id;
    if (id) {
      this.queryParams.id = id;
    }
    this.getList();
  },
  methods: {
    /** 查询角色列表 */
    getList() {
      this.loading = true;
      liststock(this.queryParams).then((response) => {
        this.roleList = response;
        this.loading = false;
      });
    },
    handleQuery() {
      this.getList();
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      const id = row.f12;
      this.$router.push("/foot/stock/" + id);
    }
  }
};
</script>
<style scoped>
.cresult{
white-space:pre-wrap;
word-break:break-word;
}
</style>